package org.surfnet.oaaas.selenium;

import org.codehaus.jackson.map.ObjectMapper;
import org.surfnet.oaaas.auth.ObjectMapperProvider;
import org.surfnet.oaaas.model.AccessTokenResponse;

public class ObjectMapperSample {
	public static void main(String[] args) {
		String tokenResponse = "{\"scope\":\"read,write\",\"access_token\":\"dc851372-01fa-474f-ba2b-daa98bca5ddd\",\"token_type\":\"bearer\",\"expires_in\":0}";
		try {
			ObjectMapper mapper = new ObjectMapperProvider()
					.getContext(ObjectMapper.class);

			AccessTokenResponse response = new AccessTokenResponse(
					"dc851372-01fa-474f-ba2b-daa98bca5ddd", "bearer", 0, null,
					"read,write");
			System.out.println(mapper.writeValueAsString(response));
			
			// AccessTokenResponse accessTokenResponse = mapper.readValue(
			// tokenResponse, AccessTokenResponse.class);
			// System.out.println(accessTokenResponse);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}
}
